package pointAndLine;


public class Line {
	
	private Point point1;
	private Point point2;
	private String lineName = null;
	
	public Line(int x1,int y1,int x2,int y2)
	{
		point1 = new Point(x1,y1);
		point2 = new Point(x2,y2);
	}
	
	public Line(Point point1, Point point2)
	{
		this.point1=point1;
		this.point2=point2;
	}
	/**
	 * @param point2 the point2 to set
	 */
	public void setPoint2(Point point2) {
		this.point2 = point2;
	}
	/**
	 * @return the point2
	 */
	public Point getPoint2() {
		return point2;
	}
	/**
	 * @param point1 the point1 to set
	 */
	public void setPoint1(Point point1) {
		this.point1 = point1;
	}
	/**
	 * @return the point1
	 */
	public Point getPoint1() {
		return point1;
	}
	
	public boolean equals(Line line)
	{
		if( this.point1.equals(line.point1) &&  this.point2.equals(line.point2)) return true;
		return false;
	}
	
	public String toString()
	{
		return "From " +point1.toString()+  " to "+ point2.toString();
	}

	/**
	 * @param lineName the lineName to set
	 */
	public void setLineName(String lineName) {
		this.lineName = lineName;
	}

	/**
	 * @return the lineName
	 */
	public String getLineName() {
		return lineName;
	}


}
